<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page language="java" import="java.util.*,com.yigerende.pojo.Manage"%>
<%
	String path = request.getContextPath();
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>紫云科技网络有限公司</title>
<link rel="stylesheet" type="text/css"
	href="<%=path%>/jsp/admin/css/common.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/jsp/admin/css/main.css" />
	
<script type="text/javascript">
//使用js来提交给后端要删除的id和类型
	function delMange(type,id){
		if (confirm("您确定要删除该用户？"))
		top.location ="<%=path%>/admin/AdminManagereServlet?flag=_delAdmin&type="+type+"&id="+id;
		return false;
	}
</script>
</head>
<body style="background:url(<%=path%>/image/856.jpg);background-repeat: no-repeat;background-position: center center;background-size: cover;">
	<jsp:include page="top.jsp" />
	<div class="container clearfix">
		<jsp:include page="left.jsp" />
		<div class="main-wrap">

			<div class="crumb-wrap">
				<div class="crumb-list">
					<i class="icon-font"></i><a href="<%=path%>/jsp/admin/index.jsp">首页</a><span
						class="crumb-step">&gt;</span><span class="crumb-name">用户管理</span>
				</div>
			</div>
			<%
			    //取到当前页面所有的数据
				List<Manage> manageList = (List<Manage>) request.getAttribute("manageList");
			%>
			<div class="result-wrap">
				<form name="myform" id="myform" method="post">
					<div class="result-title">
						<div class="result-list">
							<a href="<%=path%>/jsp/admin/addUser.jsp"><i class="icon-font"></i>添加用户</a>
						</div>
					</div>
					<div class="result-content">
						<table class="result-tab" width="100%">
							<tr>
								<th>用户名</th>
								<th>用户类型</th>
								<th>操作</th>
							</tr>
							<%
							    //把当前页面数据循环显示出来
								for (int i = 0; i < manageList.size(); i++) {
							%>
							<tr>
							         <!-- 用户名 -->
								<td><%=manageList.get(i).getName()%></td>
								     <!-- 用户类型 -->
								<td><%=manageList.get(i).getTypename()%></td>
								<td><a class="link-del" href="#"
									onClick="delMange(<%=manageList.get(i).getType()%>,<%=manageList.get(i).getId()%>);">删除</a></td>
							</tr>
							<%
								}
							%>
						</table>
						<div class="list-page">
							<a
								href="<%=path%>/admin/AdminManagereServlet?flag=_seequeryAdmin&currentPage=1">首页</a><!-- 直接给currentPage给个1 -->
							<a
								href="<%=path%>/admin/AdminManagereServlet?flag=_seequeryAdmin&currentPage=${currentPage<=1?currentPage:currentPage-1}">上一页</a>
							<a
								href="<%=path%>/admin/AdminManagereServlet?flag=_seequeryAdmin&currentPage=${currentPage<bottomPage?currentPage+1:bottomPage}">下一页</a>
							<a
								href="<%=path%>/admin/AdminManagereServlet?flag=_seequeryAdmin&currentPage=${bottomPage}">尾页</a>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!--/main-->
	</div>
</body>
</html>